<?php 

	// database connection details
	
	/* Live credentials
	$user = 'smullinstudios';
	$pass = 'march2one';
	$host = 'internal-db.s1124.gridserver.com';
	$db = 'db1124_atbat';
	*/
	
	// Local credentials
	$user = 'root';
	$pass = '';
	$host = 'localhost';
	$db = 'db1124_atbat';
	
	try {
	
		$db = new PDO('mysql:host=' . $host . ';dbname=' . $db, $user, $pass);
		$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
	
	} catch (PDOException $e) {
	
		// show user error
		print '<p class="error">Server error. Please try again later.</p>';
		
		// show me error
		mail('sean@smullinstudios.com', 'At Bat Error Message', $e->getMessage(), 'From: noreply@smullinstudios.com');
	
	}
	
?>